import Opt from '@/components/dt/info/Opt.js'
import table from '@/components/dt/table/render.js'

class Column extends Opt {

  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [{
        type: 'index',
        title: '序号',
        minWidth: 50,
      },
      {
        field: 'orgName',
        title: '所属组织',
        minWidth: 160
      },
      {
        field: 'housesName',
        title: '案场名称',
        minWidth: 180
      },
      {
        field: 'contractCode',
        title: '签约单编号',
        minWidth: 180
      },
      {
        field: 'productName',
        title: '所属产品',
        minWidth: 150
      },
      {
        field: 'roomName',
        title: '签约房源',
        minWidth: 120,
      },
      {
        field: 'area',
        title: '面积(㎡)',
        minWidth: 100,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'totalPrice',
        title: '签约总价(元)',
        minWidth: 150,
        cell: {
          text: {
            type: 'number'
          }
        }
      },
      {
        field: 'contractorName',
        title: '签约人',
        minWidth: 100,
      },
      {
        field: 'customerName',
        title: '客户姓名',
        minWidth: 100,
      },
      {
        field: 'customerPhone',
        title: '客户手机号',
        minWidth: 120,
      },
      {
        field: 'firstVisitDate',
        title: '首访日期',
        minWidth: 120,
      },
      {
        field: 'subscriptionDate',
        title: '认购日期',
        minWidth: 120,
      },
      {
        field: 'contractDate',
        title: '签约日期',
        minWidth: 120,
      },
      {
        field: 'channelName',
        title: '渠道名称',
        minWidth: 120,
      },
      {
        field: 'channelFitName',
        title: '打法名称',
        minWidth: 120,
      },
      {
        field: 'isGrantedBonus',
        title: '奖金发放情况',
        minWidth: 120,
      },
      {
        title: '操作',
        width: 250,
        fixed: 'right',
        cell: (item) => {
          return {
            btn: [{
              title: '线索详情',
              event: 'onLinkUser',
              data: [item,1]
            }, {
              title: '到访详情',
              event: 'onLinkUser',
              data: [item,0],
            }, {
              title: '订单详情',
              event: 'orderDetailFun',
              data: item
            }]
          }
        }
      },
    ]
  }

}

export default Column
